<!DOCTYPE html>
<html lang="en" class="no-js">
    <head>
        <title>文章列表</title>
    </head>

    <body>
        <form id="listForm" name="listForm" action="/articleList" method="get">
             用户id：<input type="text" id="personId" name="personId" value="<#if personId??>${personId}</#if>" />
             <button type="submit" onclick="">查询</button>
        </form>
    </body>
    <br/>
    <#if unreadArticleNum??>
        未读文章数量：${unreadArticleNum}<br/>
    </#if>
    <#if returnArticleList??>
        <table border="1">
            <tr>
                <th>文章id</th>
                <th>文章标题</th>
                <th>是否已读</th>
                <th>操作</th>
            </tr>
            <#list returnArticleList as ra>
                <tr>
                    <td>${ra.id}</td>
                    <td>${ra.title}</td>
                    <td>
                        <#if ra.isRead = 0>否</#if>
                        <#if ra.isRead = 1><span style="color:red">是</span></#if>
                    </td>
                    <td><a href="javascript:read(${ra.id})">阅读</a></td>
                </tr>
            </#list>
        </table>
    </#if>
</html>
<script>
    function read(articleId){
      personId = document.getElementById("personId").value;
      window.location.href="/readArticle?articleId="+articleId+"&personId="+personId;
    }
</script>